package us.wili.dev.model.base;

import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import us.wili.dev.common.model.BaseModelWithId;

public class BaseUser extends BaseModelWithId implements Serializable {
    @ApiModelProperty(value="用户名字")
    private String name;

    @ApiModelProperty(value="openid")
    private String openid;

    @ApiModelProperty(value="用户头像")
    private String headImgUrl;

    @ApiModelProperty(value="用户手机")
    private String phone;

    @ApiModelProperty(value="用户密码")
    private String pwd;

    @ApiModelProperty(value="盐值")
    private String salt;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }

    public String getOpenid() {
        return openid;
    }

    public void setOpenid(String openid) {
        this.openid = openid == null ? null : openid.trim();
    }

    public String getHeadImgUrl() {
        return headImgUrl;
    }

    public void setHeadImgUrl(String headImgUrl) {
        this.headImgUrl = headImgUrl == null ? null : headImgUrl.trim();
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone == null ? null : phone.trim();
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd == null ? null : pwd.trim();
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt == null ? null : salt.trim();
    }

    public void copyPropertiesFrom(BaseUser source) {
        this.setName(source.getName());
        this.setOpenid(source.getOpenid());
        this.setHeadImgUrl(source.getHeadImgUrl());
        this.setPhone(source.getPhone());
        this.setPwd(source.getPwd());
        this.setSalt(source.getSalt());
    }

    public void copyAndIgnoreNullFrom(BaseUser source) {
        if (source.getName() != null) {
            this.setName(source.getName());
        }
        if (source.getOpenid() != null) {
            this.setOpenid(source.getOpenid());
        }
        if (source.getHeadImgUrl() != null) {
            this.setHeadImgUrl(source.getHeadImgUrl());
        }
        if (source.getPhone() != null) {
            this.setPhone(source.getPhone());
        }
        if (source.getPwd() != null) {
            this.setPwd(source.getPwd());
        }
        if (source.getSalt() != null) {
            this.setSalt(source.getSalt());
        }
    }
}